import { Pipe, PipeTransform } from '@angular/core';
import { DateTime } from 'luxon';
import { DateTimeHelper } from '@shared/helpers/DateTimeHelper';

@Pipe({ name: 'timestampFormat' })
export class TimestampFormatPipe implements PipeTransform {
    transform(value: number, format: string) {
        if (!value) {
            return '';
        }

        return DateTimeHelper.FromUnixTimestampByMilliseconds(value).toFormat(format);
    }
}
